package com.haiyou.common.thread.policy;

import java.util.concurrent.ThreadPoolExecutor;

import lombok.extern.jbosslog.JBossLog;
import lombok.extern.slf4j.Slf4j;

/**
 * 
 * shutdown 继续把剩下的任务走完,部分需求需要
 * @author xingyuan
 * @date 2023年12月12日 下午3:24:39
 */
@Slf4j
public class ShutdownFlushRejectedPolicy extends ThreadPoolExecutor.CallerRunsPolicy {
	
	public static final ShutdownFlushRejectedPolicy instance = new ShutdownFlushRejectedPolicy();

	private ShutdownFlushRejectedPolicy() {
		super();
	}
	
	@Override
	public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
		r.run();
	}

}
